package com.armed.client.interfaz.medicos;

import init.org.util.Constants;
import java.awt.Component;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

/**
 * Class ColumnEspecialidadTableRenderer
 *
 *
 * @author init() software
 * @version 29/01/2008 
 */
public class ColumnEspecialidadTableRenderer extends DefaultTableCellRenderer
{
    @Override
    public Component getTableCellRendererComponent(JTable table, Object value,boolean isSelected, boolean hasFocus, int row, int column) 
    {
        Component component = super.getTableCellRendererComponent(table, value,isSelected, hasFocus, row, column);
        if (value != null && value instanceof String) 
        {
            ((JLabel) component).setIcon(new ImageIcon(getClass().getResource(Constants.MEDICAL_BAG_ICON)));
            ((JLabel) component).setHorizontalAlignment(JLabel.LEFT);
            ((JLabel) component).setText(String.valueOf(value));
            return component;
        }
        return component;
    }
}
